$(function() {
	var tableSource = new $.jqx.dataAdapter({
		dataType : "json",
		dataFields : [ {
			name : "id",
			type : "int"
		}, {
			name : "name",
			type : "string"
		} ],
		id : "id",
		url : "icategory/all.do"
	});
	$("#dataTable").jqxDataTable({
		width : "100%",
		source : tableSource,
		pageable : true,
		pageSize : 15,
		serverProcessing : true,
		pagerButtonsCount : 10,
		columnsResize : true,
		sortable : true,
		columns : [ {
			text : "序号",
			width : 50,
			cellsRenderer : function(row) {
				return (row + 1).toString();
			}
		}, {
			text : "名称",
			dataField : "name"
		} ],
	});
	$("#dataTable")
			.on(
					"rowDoubleClick",
					function(info, args) {
						if (args && args.flag) {
							info = args;
						}
						editingIndex = info.args.index;
						editingData = info.args.row;
						_editerIndex = layer
								.open({
									id : "icategoryEditer",
									title : "添加行业分类",
									type : 1,
									skin : "layui-layer-rim",
									area : [ "360px", "130px" ],
									content : '<form id="icategory-editer" class="form" method="post" enctype="multipart/form-data" style="height: 100%;overflow: auto;">'
											+ '<input type="hidden" name="id" />'
											+ '<input type="hidden" name="submit-url" value="icategory/add.do" />'
											+ '<div class="input-box">'
											+ '<label class="from-label update" for="name">类型名称：</label>'
											+ '<input type="text" name="name" allowBlank="false" class="form-control" placeholder="类型名称" />'
											+ '</div>'
											+ '</form>'
											+ '<div class="form" style="position: absolute;bottom: 0px;width: 100%;text-align: right;background-color: #DDD;">'
											+ '<input type="button" class="btn btn-sm btn-success" onclick="submitEditer(this)" value="保存"/>'
											+ '<input type="button" class="btn btn-sm btn-info" onclick="closeEditer(this)" value="返回"/>'
											+ '</div>',
								});
					});
});